// import { loginState } from "../action/login";

//定义一个对象用来存放props

const defaultState={
  name:"111",
  loginState:false,//用户的登录状态  
}

function user(state=defaultState,action){
    switch(action.type){
        case "CAHNGNAME":
        return  Object.assign({},state,{name:action.data.name,loginState:true});
        case "FALSELOGIN"://注销的 操作
        return  Object.assign({},state,{loginState:false,name:"登录失败，用户名或密码错误"});   
        default:
            return state;
        
    }
}

export default user;



